/**
 * @param {string} digits
 * @return {string[]}
 */
var letterCombinations = function(digits) {
    // 定义一个字典 下标代表数字
    const dict = ['' ,'', "abc", 'def', "ghi", "jkl", 'mno', 'pqrs', 'tuv', 'wxyz']
    let len = digits.length
    if(len == 0) return []
    let ans = []
    let path = new Array(len).fill('')
    const dfs = function(i)  {
        if(i === n) {
            ans.push(path.join(''))
            return
        }
        for(let j = 0; j < dict[i].length; j++) {
            path[i] = dict[i].charAt(j)
            dfs(i + 1)
        }
    }
    dfs(0)
    return ans
};